package org.flow.basic.doubts.tjbase;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TryDemoTest {

    private static final Logger log = LoggerFactory.getLogger(TryDemoTest.class);

    public static void main(String[] args) {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000; i++) {
            try {
                System.out.printf("测试学习 try 的信息 %s", "try 的学习");
            } catch (Exception e) {
                log.error("", e);
            }
        }
        long end = System.currentTimeMillis();
        log.info("{}", (end - start));

        for (int i = 0; i < 1000; i++) {
            log.info("测试学习 try 的信息 try 的学习");
        }

        log.info("\n{}", ((System.currentTimeMillis()) - end));

        for (int i = 0; i < 1000; i++) {
            try {
                log.info("测试学习 try 的信息 try 的学习。");
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        System.out.println();
        System.out.println(((System.currentTimeMillis()) - end));
    }
}
